﻿@model HomePageViewModel
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewData["Title"] = "湖北省检察院档案管理系统 - 主页";
}
@section Head{
    <style type="text/css">
        #dTop {
            height: 80px;
            background-color: #2F4050;
        }

        #dTopMain {
            width: 1200px;
            margin: 0 auto;
            position: relative;
        }

            #dTopMain .nav > li > a:focus, #dTopMain .nav > li > a:hover {
                background-color: #fff;
                color: #333;
            }

            #dTopMain .nav > li > a {
                color: #fff;
            }

            #dTopMain .nav .open > a, #dTopMain .nav .open > a:focus, #dTopMain .nav .open > a:hover {
                color: inherit;
            }

            #dTopMain .navbar-top-links li:last-child {
                margin-right: 0px;
            }

            #dTopMain .navbar-top-links li a {
                padding: 14px 20px;
                min-height: initial;
            }

            #dTopMain .dropdown-menu > li > a:focus, #dTopMain .dropdown-menu > li > a:hover {
                background-color: #DFF0D8;
            }
        /*#dTopMain .nav > li > a:focus, .nav > li > a:hover { background-color:#fff; color:#333; }*/
    </style>
}

@*<div id="dTop">
        <div id="dTopMain">
            <img alt="image" class="img-circle" style="width: 64px; height: 64px; margin-top: 8px; float: left;" src="/img/logo.png" />
            <div class="navbar-collapse collapse" id="navbar" style="float: left; width: 1120px; margin-left: 8px; margin-top: 16px;">
                @await Component.InvokeAsync("RTW.Web.Component.TopRoleMenuList", new { userid = Model.user.Id })
                <ul class="nav navbar-top-links navbar-right">
                    <li>
                        <span style="color: #fff; font-size: 15px; font-weight: bold; font-style: italic; padding: 14px 20px;"><i class="fa fa-user" style="margin-right: 6px;"></i>@Model.user.UserName</span>
                    </li>
                    <li>
                      <button ID="lbtnClose" runat="server" OnClick="lbtnClose_Click" OnClientClick="return LoginOut()"><i class="fa fa-sign-out"></i>退出</button>
                    </li>
                </ul>
            </div>
        </div>
    </div>*@
@await Html.PartialAsync("../Shared/_Top")
<div id="dMain" style="position: relative; margin: 0 auto; float: none;">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-4">
                @await Html.PartialAsync("_UserInfo", Model.user)
                @await Html.PartialAsync("_download", Model.download)
                @await Html.PartialAsync("_timeline", Model.timelog)
            </div>

            <div class="col-sm-8" style="padding-right: 0px;">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>档案统计</h5>
                    </div>
                    <div id="dContent2" class="ibox-content">
                        <p id="home">
                            @Html.Raw(ViewBag.home)
                        </p>
                    </div>
                </div>
                <div class="ibox float-e-margins">
                    <div class="ibox-title" style="position: relative;">
                        <h5>档案存放示意图</h5>
                    </div>
                    <div class="ibox-content" style="min-height: 400px; position: relative;">
                        @if (Model.user.DM.Remarks == "")
                        {
                            <div style="font-family: 'Microsoft YaHei' ; font-size: 30px; color: #ddd; text-align: center; padding-top: 150px;">暂无示意图</div>
                        }
                        else
                        {
                            @Html.Raw(Model.user.DM.Remarks)
                        }
                    </div>
                </div>
                @await Html.PartialAsync("_eventmsg", Model.msgs)
            </div>
        </div>
    </div>
</div>


@section scripts{
    <script type="text/javascript">
        $(function () {

            $.ajax({
                type: "POST",
                url: "/Home/LoadMenu",
                success: function (data) {
                    $("#nav").html(data);
                },
                error: function (data) {
                    alert(22);
                    alert(data);

                }
            });
            var len = $(".feed-activity-list .feed-element").length;
            if (len == 0) {
                $("#dNoMsg").show();
                return;
            }
        })

        //标记为已读
        function SetLook(obj, _MsgID) {
            $.ajax({
                type: "post",
                url: "/ashx/EditData.ashx",
                dataType: "json",
                async: true,
                cache: false,
                data: { type: "SetLook", MsgID: _MsgID },
                success: function (msg) {
                    $(obj).parents("div.feed-element").addClass("bounceOutUp");
                    setTimeout(function () {
                        $(obj).parents("div.feed-element").hide();
                    }, 500);
                }
            });
        }

        function SetLookAll() {
            var len = $(".feed-activity-list .feed-element").length;
            if (len == 0) {
                showTip("没有未读消息！", 7, 0);
                return;
            }
            _Confirm('确定要删除这条数据？', function () {
                $.ajax({
                    type: "post",
                    url: "/ashx/EditData.ashx",
                    dataType: "json",
                    async: true,
                    cache: false,
                    data: { type: "SetLookAll" },
                    success: function (msg) {
                        location.href = location.href;
                    }
                });
            })
        }
    </script>
    <script type="text/javascript">
        function LoginOut() {
            return confirm("确定要退出系统？");
        }
    </script>
}